import random
import json
from fastapi import APIRouter

router = APIRouter(
    prefix="/gj-rag",
    tags=["query"],
    responses={404: {"description": "Not found"}}
)

with open('data/question.json', 'r', encoding='utf-8') as json_file:
    questions = json.load(json_file)

@router.get("/random_question")
async def random_question():
    selected_questions = random.sample(questions, 5)
    return  {"selected_questions": selected_questions}
 